<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="renderer" content="webkit">
<title></title>

<link type="text/css" rel="stylesheet" href="../Public/css/reset.css">
<link type="text/css" rel="stylesheet" href="../Public/css/DateTimePicker.css">
<link type="text/css" rel="stylesheet" href="../Public/css/style.css">
<link type="text/css" rel="stylesheet" href="../Public/css/user.css">
<script type="text/javascript" src="../Public/script/jquery.js"></script>
<script type="text/javascript" src="../Public/script/distpicker.data.js"></script>
<script type="text/javascript" src="../Public/script/distpicker.js"></script>
<script type="text/javascript" src="../Public/script/DateTimePicker.js"></script>
<script type="text/javascript" src="../Public/layer/layer.js"></script>
<script type="text/javascript" src="../Public/script/jquery.SuperSlide.2.1.1.js"></script>

</head>


<style>
 #message_Get_ymz{
width: 22%;
    position: absolute;
    right: 23%;
    top: 50%;
    font-size: 14px;
    margin-top: -12px;
    padding: 0 2px;
    height: 24px;
    color: #0D906A;
    line-height: 24px;
    display: block;
    border: #49bf9d  solid 1px;
    border-radius: 12px;
    cursor: pointer;
 }

</style>
<body>
<script>

function checkReg()
{





    if(document.form1.phone.value=="")
  {
     layer.alert("您的手机号还没有填写");
   document.form1.phone.focus();
   return false;
  }
    if(document.form1.phone.value.length!=11)
  {
     layer.alert("您的手机号格式不对");
   document.form1.phone.focus();
   return false;
  }
 
    if(document.form1.yanzhengma.value=="")
  {
     layer.alert("您的短信验证码还没有填写");
   document.form1.yanzhengma.focus();
   return false;
  }
var myreg = /^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1}))+\d{8})$/; 
       if(!myreg.test(document.form1.phone.value)) 
       { 
           layer.alert('请输入有效的手机号码！'); 
           document.form1.phone.focus(); 
           return false; 
       } 
   



    if(document.form1.password.value=="")
  {
     layer.alert("您的新密码还没有填写");
   document.form1.password.focus();
   return false;
  }
   if(document.form1.password.value!=document.form1.pwdconfirm.value)
  {
     layer.alert("两次密码输入必须一致");
   document.form1.password.focus();
   return false;
  }
   if(document.form1.password.value.length<6)
  {
     layer.alert("密码最少六位");
   document.form1.password.focus();
   return false;
  }


}



</script>
<include file="Common:header" />

<div class="w1100 mr_b20 contain" >
  <div class="reg_bg border1 oh">

    <div class="member_reg clear">
      <div class="reg_left fl">
     			 <form method="post" action="" id="myform" name="form1">
                        <div class="reg_item">
                             <label style="    display: block;
    width: 60%;
    text-align: center;
    background-color: white;
    font-size: 16px;">修改密码</label>
                                </div>
                            
   <div class="reg_item">
              <label class="basic_label"><span class="red">*</span> 手机号</label>
                <input name="phone" style="text-indent: 50px" id="phone" label="手机号码" placeholder="请输入有效手机号"   type="text" class="basic_input">
            </div>


 <div class="reg_item">
              <label class="basic_label" ><span class="red">*</span>验证码</label>
                <input name="yanzhengma" style="text-indent: 50px" id="code" label="" placeholder="请输入短信验证码"   type="text" class="basic_input">
                 <input id="message_Get_ymz" type="button" value="获取短信验证码" onClick="sendMessage()" />

            </div>
                      


                     <div class="cle"></div>


             <div class="cle"></div>
            
      
     				  <div class="reg_item">
							<label class="basic_label"><span class="red">*</span>新密码</label>
							<input type="password" id="password" name="password"  placeholder="6~18位字符" class="basic_input"  maxlength="18" >
						</div>
                       <div class="reg_item">
							<label class="basic_label"><span class="red">*</span>确认密码</label>
							<input type="password" id="pwdconfirm" name="pwdconfirm"  placeholder="两次密码输入必须一致" class="basic_input"  maxlength="18" >
						</div>
			



                     <div class="cle"></div>


          <div class="reg_item">
            <p>
              <input type="submit" class="user_reg_sub" value="修改完成" name="dosubmit" id="dosubmitvv" onclick="return checkReg();">
            </p>
          </div>
    
        </form>
      </div>
    </div>
  </div>
</div>
<script>

var InterValObj; //timer变量，控制时间
var count = 300; //间隔函数，1秒执行
var curCount;//当前剩余秒数



function sendMessage() {
 curCount = count;
 var phone=$('#phone').val();
 if(phone != ""){

    $.ajax({
      type: "post", //用POST方式传输
      async : false,
      url: '{:U("Zixun/xiugai")}', //目标地址
      data: {"phone":phone},

      success: function (msg){
          if (msg == 1) {
          $("#message_Get_ymz").attr("disabled", "true");
          $("#message_Get_ymz").val("请在" + curCount + "秒内输入验证码");
          InterValObj = window.setInterval(SetRemainTime, 1000);
          layer.msg("成功",{time:1000});
        }else{
          layer.alert("该手机号未注册！");
        }
 

       }
    });
  }else{
    layer.alert("手机号码不能为空！");
  }

}
function SetRemainTime() {
  if (curCount == 0) {                
    window.clearInterval(InterValObj);//停止计时器
    $("#message_Get_ymz").removeAttr("disabled");//启用按钮
    $("#message_Get_ymz").val("重新发送验证码");
    code = ""; //清除验证码。如果不清除，过时间后，输入收到的验证码依然有效    
  }
  else {
    curCount--;
    $("#message_Get_ymz").val("请在" + curCount + "秒内输入验证码");
  }
}
</script>

<div class="clear"></div>
<include file="Common:footer" />
</body>
</html>
